<template>
	<view class="tupian flex_center" @tap="navigateBack">
		<image class="back" src="@/static/img/back.png" mode=""></image>
	</view>
</template>

<script>
	export default {
		name: "headerView",
		data() {
			return {

			};
		},
		methods: {
			navigateBack() {
				let backPage = getCurrentPages()
				if (backPage.length == 1) {
					uni.switchTab({
						url: "/pages/home/home"
					})
				} else {
					uni.navigateBack()
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.tupian {
		width: 72rpx;
		height: 72rpx;
		background-color: hsla(0, 0%, 92.9%, .46);
		border-radius: 20rpx;

		.back {
			width: 42rpx;
			height: 42rpx;
		}
	}
</style>